package com.ruoyi.training.service.impl;

import java.util.List;

import com.ruoyi.training.domain.TrainPlanCurriculum;
import com.ruoyi.training.mapper.TrainPlanCurriculumMapper;
import com.ruoyi.training.service.ITrainPlanCurriculumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 培训计划课程关联Service业务层处理
 *
 * @author wng
 * @date 2024-08-04
 */
@Service
public class TrainPlanCurriculumServiceImpl implements ITrainPlanCurriculumService {
    @Resource
    private TrainPlanCurriculumMapper trainPlanCurriculumMapper;

    /**
     * 查询培训计划课程关联
     *
     * @param id 培训计划课程关联主键
     * @return 培训计划课程关联
     */
    @Override
    public TrainPlanCurriculum selectTrainPlanCurriculumById(Long id) {
        return trainPlanCurriculumMapper.selectTrainPlanCurriculumById(id);
    }

    /**
     * 查询培训计划课程关联列表
     *
     * @param trainPlanCurriculum 培训计划课程关联
     * @return 培训计划课程关联
     */
    @Override
    public List<TrainPlanCurriculum> selectTrainPlanCurriculumList(TrainPlanCurriculum trainPlanCurriculum) {
        return trainPlanCurriculumMapper.selectTrainPlanCurriculumList(trainPlanCurriculum);
    }

    /**
     * 新增培训计划课程关联
     *
     * @param trainPlanCurriculum 培训计划课程关联
     * @return 结果
     */
    @Override
    public int insertTrainPlanCurriculum(TrainPlanCurriculum trainPlanCurriculum) {
        return trainPlanCurriculumMapper.insertTrainPlanCurriculum(trainPlanCurriculum);
    }

    /**
     * 修改培训计划课程关联
     *
     * @param trainPlanCurriculum 培训计划课程关联
     * @return 结果
     */
    @Override
    public int updateTrainPlanCurriculum(TrainPlanCurriculum trainPlanCurriculum) {
        return trainPlanCurriculumMapper.updateTrainPlanCurriculum(trainPlanCurriculum);
    }

    /**
     * 批量删除培训计划课程关联
     *
     * @param ids 需要删除的培训计划课程关联主键
     * @return 结果
     */
    @Override
    public int deleteTrainPlanCurriculumByIds(Long[] ids) {
        return trainPlanCurriculumMapper.deleteTrainPlanCurriculumByIds(ids);
    }

    /**
     * 删除培训计划课程关联信息
     *
     * @param id 培训计划课程关联主键
     * @return 结果
     */
    @Override
    public int deleteTrainPlanCurriculumById(Long id) {
        return trainPlanCurriculumMapper.deleteTrainPlanCurriculumById(id);
    }
}
